package com.example.demo.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    // 构造方法
    @RequestMapping("/sayhi")
    public String sayHi(){
        System.out.println("执行了 say sayHi");
        return "say sayHi";
    }


    @RequestMapping("/helloword")
    public String helloWord() {
        int ret = 10/0;//算法错误 执行AfterThrowing
        System.out.println("执行了 say helloWord");
        return "say helloWord";
    }

}
